﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace DARE
{
    public class CProgressBarData : CWidgetData
    {
        public Color barColor;
        public CHudTextureData barTexture;
        public bool displayText;
        public float progress;
        public bool stretchBar;
        public Color textColor;

        public override void FillDataStructure(CWidget wid)
        {
            CProgressBar w = wid as CProgressBar;
            base.FillDataStructure(wid);
            barColor = w.BarColor;
            barTexture = new CHudTextureData();
            barTexture.FillDataStructure(w.BarTexture);
            displayText = w.DisplayText;
            progress = w.Progress;
            stretchBar = w.StretchBar;
            textColor = w.TextColor;
        }

        public override void FillFromDataStructure(ref CWidget wid, CHUDSystem hud)
        {
            base.FillFromDataStructure(ref wid, hud);
            (wid as CProgressBar).BarColor = barColor;
            CHudTexture tex = new CHudTexture();
            barTexture.FillFromDataStructure(tex);
            (wid as CProgressBar).BarTexture = tex;
            (wid as CProgressBar).DisplayText = displayText;
            (wid as CProgressBar).Progress = progress;
            (wid as CProgressBar).StretchBar = stretchBar;
            (wid as CProgressBar).TextColor = textColor;
        }
    }
}
